package test.com.linkgie.galaxyframework.httpproxy.core;

import java.io.InputStream;

import com.linkgie.galaxyframework.httpproxy.HttpServiceContext;
import com.linkgie.galaxyframework.httpproxy.ResponseConverter;
import com.linkgie.galaxyframework.httpproxy.converters.JsonResponseConverter;
import com.linkgie.galaxyframework.httpproxy.core.ServiceRequest;

public class GetContentResponseConverter implements ResponseConverter {

	private JsonResponseConverter jsonResponseConverter = new JsonResponseConverter(DataResponse.class);

	@Override
	public Object getResponse(ServiceRequest request, InputStream responseStream, HttpServiceContext serviceContext) throws Exception {
		DataResponse data = (DataResponse) jsonResponseConverter.getResponse(request, responseStream, null);
		return data.getContent();
	}

}
